package com.xlx.openLink.entity.pojo;

import com.fasterxml.jackson.annotation.JsonFormat;
import org.apache.commons.lang3.builder.EqualsBuilder;
import org.apache.commons.lang3.builder.HashCodeBuilder;

import java.io.Serializable;
import java.util.Date;
import java.util.Objects;

public class Speed implements Serializable {
    private String pkGuid;

    private String devId;

    private String pId;

    private String spPName;

    private String spDevName;
    private Double spOutSpeed;

    private Double spInSpeed;

    private Long spOutoctets;

    private int spPIndex;

    private Long spInoctets;

    private Date spCreateDate;

    private static final long serialVersionUID = 1L;

    public String getPkGuid() {
        return pkGuid;
    }

    public void setPkGuid(String pkGuid) {
        this.pkGuid = pkGuid == null ? null : pkGuid.trim();
    }

    public String getDevId() {
        return devId;
    }

    public void setDevId(String devId) {
        this.devId = devId == null ? null : devId.trim();
    }

    public String getpId() {
        return pId;
    }

    public void setpId(String pId) {
        this.pId = pId == null ? null : pId.trim();
    }

    public Double getSpOutSpeed() {
        return spOutSpeed;
    }

    public void setSpOutSpeed(Double spOutSpeed) {
        this.spOutSpeed = spOutSpeed;
    }

    public String getSpPName() {
        return spPName;
    }

    public void setSpPName(String spPName) {
        this.spPName = spPName;
    }

    public String getSpDevName() {
        return spDevName;
    }

    public void setSpDevName(String spDevName) {
        this.spDevName = spDevName;
    }

    public Double getSpInSpeed() {
        return spInSpeed;
    }

    public void setSpInSpeed(Double spInSpeed) {
        this.spInSpeed = spInSpeed;
    }

    public Long getSpOutoctets() {
        return spOutoctets;
    }

    public void setSpOutoctets(Long spOutoctets) {
        this.spOutoctets = spOutoctets;
    }

    public Long getSpInoctets() {
        return spInoctets;
    }

    public void setSpInoctets(Long spInoctets) {
        this.spInoctets = spInoctets;
    }

    @JsonFormat(timezone = "GMT+8", pattern = "yyyy-MM-dd HH:mm:ss")
    public Date getSpCreateDate() {
        return spCreateDate;
    }

    public void setSpCreateDate(Date spCreateDate) {
        this.spCreateDate = spCreateDate;
    }

    public int getSpPIndex() {
        return spPIndex;
    }

    public void setSpPIndex(int spPIndex) {
        this.spPIndex = spPIndex;
    }

    @Override
    public boolean equals(Object o) {
        if (this == o) {
            return true;
        }
        if (!(o instanceof Speed)) {
            return false;
        }
        Speed speed = (Speed) o;

        return new EqualsBuilder().append(spPIndex, speed.spPIndex).append(devId, speed.devId).append(pId, speed.pId).isEquals();
    }

    @Override
    public int hashCode() {
        return new HashCodeBuilder(17, 37).append(devId).append(pId).append(spPIndex).toHashCode();
    }
}